package unit2_1010.test5;

public class Cat {

	private String name;
	private int health;
	private String sex;
	private int lazy;

	public Cat() {
		super();
	}

	public Cat(String name, int health, String sex, int lazy) {
		super();
		this.name = name;
		this.health = health;
		this.sex = sex;
		this.lazy = lazy;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getHealth() {
		return health;
	}

	public void setHealth(int health) {
		if (health < 1 || health > 100) {
			System.out.println("健康值应在1-100之间，默认60");
			health = 60;
		}
		this.health = health;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public int getLazy() {
		return lazy;
	}

	public void setLazy(int lazy) {
		if (lazy < 1 || lazy > 10) {
			System.out.println("有效亲密度在1-10之间，默认为5");
			lazy = 5;
		}
		this.lazy = lazy;
	}

	public void show() {
		System.out.println("宠物猫自白：\n" + "昵称：" + name + ",性别：" + sex + ",健康值：" + health + ",懒度：" + lazy);
	}

}
